<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- 样式 -->
<style type="text/css">
	body {background-color: black}
    table {
    	width:90%;
    	background:black;
    	margin: 10px auto;
    	border-collapse:collapse;
    }
	th, td {
		height:25px;
		line-height:25px;
		text-align:center;
		border:1px solid #ccc;
	}
</style>

<title>武神传说计算工具</title>

<script type="text/javascript">
	var timer = null; // 计时器

	function start() {
		timer = setTimeout("start()", 1000); // 每1秒执行一次
		run(); // 执行数值的计算

		var time = new Date();
		var hours = time.getHours();
		var minutes = time.getMinutes();
        var seconds = time.getSeconds();
        var text = "Time　";
		if (time.getHours()<10) hours = "0" + hours;
		if (time.getMinutes()<10) minutes = "0" + minutes;
		if (time.getSeconds()<10) seconds = "0" + seconds;
        document.getElementById('time').innerHTML = hours+":"+minutes+":"+seconds;
        // 显示当前的时间
	}

	function stop() {
		clearTimeout(timer); // 清楚计时器
	}


	function run() {
		var csdj = parseInt(document.getElementById('csdj').innerText);
		var mbdj = parseInt(document.getElementById('mbdj').innerText);
		var xtwx = parseInt(document.getElementById('xtwx').innerText);
		var htwx = parseInt(document.getElementById('htwx').innerText);
		var xxxl = parseFloat(document.getElementById('xxxl').innerText);
		var lxxl = parseFloat(document.getElementById('lxxl').innerText);

		var qianneng = mbdj * mbdj - csdj * csdj;

		document.getElementById('qn1').innerHTML = qianneng * 2.5;
		document.getElementById('qn2').innerHTML = qianneng * 5;
		document.getElementById('qn3').innerHTML = qianneng * 7.5;
		document.getElementById('qn4').innerHTML = qianneng * 10;
		document.getElementById('qn5').innerHTML = qianneng * 12.5;
		document.getElementById('qn6').innerHTML = qianneng * 15;

		var lx = qianneng/(xtwx+htwx)/(100/100+lxxl/100-xtwx/100)/12;

		document.getElementById('lx1').innerHTML = timeText(lx*2.5);
		document.getElementById('lx2').innerHTML = timeText(lx*5);
		document.getElementById('lx3').innerHTML = timeText(lx*7.5);
		document.getElementById('lx4').innerHTML = timeText(lx*10);
		document.getElementById('lx5').innerHTML = timeText(lx*12.5);
		document.getElementById('lx6').innerHTML = timeText(lx*15);

		var xx = qianneng/(xtwx+htwx)/(100/100+xxxl/100-xtwx/100)/12/3;

		document.getElementById('xx1').innerHTML = timeText(xx*2.5);
		document.getElementById('xx2').innerHTML = timeText(xx*5);
		document.getElementById('xx3').innerHTML = timeText(xx*7.5);
		document.getElementById('xx4').innerHTML = timeText(xx*10);
		document.getElementById('xx5').innerHTML = timeText(xx*12.5);
		document.getElementById('xx6').innerHTML = timeText(xx*15);

		var nl_now = parseInt(document.getElementById('nl_now').innerText);
		var nl_top = parseInt(document.getElementById('nl_top').innerText);
		var nl_per10 = parseInt(document.getElementById('nl_per10').innerText);

		var nlsj = (nl_top - nl_now) / (nl_per10 * 6);
		document.getElementById('dzsj').innerHTML = timeText(nlsj);

		var nl = parseInt(document.getElementById('nl').innerText);
		var xtgg = parseInt(document.getElementById('xtgg').innerText);
		var htgg = parseInt(document.getElementById('htgg').innerText);
		var shjd = nl/100 + xtgg*htgg/10;
		document.getElementById('shjd').innerHTML = shjd;
		if (shjd < 5000) {
			document.getElementById('kaihua1').innerHTML = "你的分值不够！";
			document.getElementById('kaihua2').innerHTML = "开启人花需要5000分！地花6500分！天花8000分！";
		} else if (shjd < 6500) {
			document.getElementById('kaihua1').innerHTML = "你可以开启人花！";
			document.getElementById('kaihua2').innerHTML = "地花需要6500分！天花需要8000分！";
		} else if (shjd < 8000) {
			document.getElementById('kaihua1').innerHTML = "你可以开启人花！地花！";
			document.getElementById('kaihua2').innerHTML = "天花需要8000分！";
		} else {
			document.getElementById('kaihua1').innerHTML = "恭喜!";
			document.getElementById('kaihua2').innerHTML = "你可以尝试完成三花聚顶！";
		}
	}


	// *分钟 ->转化为-> *天*小时*分钟
	function timeText(t) {
		if (t < 60) {
			var text = "";
			text = text + parseInt(t) + "分钟";
			return text;
		} else {
			var text = "";
			var d = "";
			var h = parseInt(t/60);
			var m = parseInt(t%60);

			if (h>24) {
				var d = parseInt(h/24);
				h = h % 24;
				text = text + d + "天";
			}
			text = text + h + "小时" + m + "分钟";
			return text;
		}
	}



	// END
</script>
</head>


<body onload="start()" onunload="stop()">

	<p align="center" id="test" style="color: white"><big><big>武神传说计算工具V1.0</big></big></p>

	<HR><br>

	<table align="center" border="1">
		<tr align="center" style="color: white">
			<th>初始等级</th>
			<th>目标等级</th>
			<th>先天悟性</th>
			<th>后天悟性</th>
			<th>学习效率</th>
			<th>练习效率</th>
		</tr>
		<tr align="center" bgcolor="white">
			<td contenteditable="true" id="csdj">1000</td>
			<td contenteditable="true" id="mbdj">1500</td>
			<td contenteditable="true" id="xtwx">50</td>
			<td contenteditable="true" id="htwx">500</td>
			<td contenteditable="true" id="xxxl">100%</td>
			<td contenteditable="true" id="lxxl">200%</td>
		</tr>
	</table>

	<br>

	<table align="center">
		<tr style="color: white">
			<th>功法颜色</th>
			<th>需要潜能</th>
			<th>练习时间</th>
			<th>学习时间</th>
		</tr>
		<tr style="color: white">
			<td>白色</td>
			<td id="qn1"></td>
			<td id="lx1"></td>
			<td id="xx1"></td>
		</tr>
		<tr style="color: #33CC33">
			<td>绿色</td>
			<td id="qn2"></td>
			<td id="lx2"></td>
			<td id="xx2"></td>
		</tr>
		<tr style="color: aqua">
			<td>蓝色</td>
			<td id="qn3"></td>
			<td id="lx3"></td>
			<td id="xx3"></td>
		</tr>
		<tr style="color: yellow">
			<td>黄色</td>
			<td id="qn4"></td>
			<td id="lx4"></td>
			<td id="xx4"></td>
		</tr>
		<tr style="color: #CC00FF">
			<td>紫色</td>
			<td id="qn5"></td>
			<td id="lx5"></td>
			<td id="xx5"></td>
		</tr>
		<tr style="color: orange">
			<td>橙色</td>
			<td id="qn6"></td>
			<td id="lx6"></td>
			<td id="xx6"></td>
		</tr>
	</table>

	

	<br><HR><br>

	<table>
		<tr style="color: white">
			<th>当前内力</th>
			<th>先天根骨</th>
			<th>后天根骨</th>
			<th>三花聚顶</th>
			<th>
				<i id="kaihua1" style="color: white"></i>
			</th>
		</tr>
		<tr>
			<td contenteditable="true" bgcolor="white" id="nl">500000</td>
			<td contenteditable="true" bgcolor="white" id="xtgg">50</td>
			<td contenteditable="true" bgcolor="white" id="htgg">1000</td>
			<td style="color: white" id="shjd"></td>
			<td><i id="kaihua2" style="color: #FF6699"></i></td>
		</tr>
	</table>
	
	<p align="center">
		
	</p>
	<br><HR><br>

	<table>
		<tr style="color: white">
			<th>当前内力</th>
			<th>内力上限</th>
			<th>每跳加内</th>
			<th>打坐满内力需要的时间</th>
		</tr>
		<tr>
			<td contenteditable="true" bgcolor="white" id="nl_now">500000</td>
			<td contenteditable="true" bgcolor="white" id="nl_top">1000000</td>
			<td contenteditable="true" bgcolor="white" id="nl_per10">50</td>
			<td id="dzsj" style="color: white"></td>
		</tr>
	</table>

	<b></b>

	<br><HR><br>


	<div id="time" style="color: white"></div>
	<div style="color: white">Author苏轻QQ874717373@20180918</div>
</body>
</html>